import 'package:dio/dio.dart';
import 'package:get/get.dart';

class DioConfig {
  late String _baseUrl;
  String? _proxy;
  String? _cookiesPath;
  List<Interceptor>? _interceptors;

  String get baseUrl => _baseUrl;
  String? get proxy => _proxy;
  String? get cookiesPath => _cookiesPath;
  List<Interceptor>? get interceptors => _interceptors;

  void init(String baseUrl,
      {List<Interceptor>? interceptors, String? proxy, String? cookiesPath}) {
    _baseUrl = baseUrl;
    _interceptors = interceptors;
    _proxy = proxy;
    _cookiesPath = cookiesPath;
  }

  static DioConfig of() => Get.find<DioConfig>();
}
